Skip to content

Conversation

@kinyoklion
Copy link
Member

@kinyoklion kinyoklion commented Jan 27, 2026

BEGIN_COMMIT_OVERRIDE
chore: Add support for FDv1 fallback.
chore: Implement FDv2 Data Source Status.
chore: Extend FDv2 Data source logging.
END_COMMIT_OVERRIDE

I would like to still add more detail to logging, but I added the basics in this PR.


Note

Medium Risk
Touches core data acquisition/failover behavior (FDv2 synchronizer selection, fallback to FDv1, and status transitions), so regressions could impact initialization and live flag updates despite good test coverage.

Overview
Adds FDv1 fallback support for FDv2 data systems: the contract-test harness can now configure an FDv1 polling fallback, and FDv2DataSystem can wrap an FDv1 DataSource as an FDv2 Synchronizer via the new DataSourceSynchronizerAdapter.

Refactors FDv2 source selection by replacing SynchronizerStateManager with a new SourceManager, and updates FDv2DataSource to properly trigger/lock in FDv1 fallback when requested, emit clearer DataSourceStatusProvider updates (VALID/INTERRUPTED/OFF) including on exhaustion/close, and add basic logging around fallback/recovery and errors. Contract-test suppression for “fallback to FDv1 handling” is removed and extensive unit tests are added/updated accordingly.

Written by Cursor Bugbot for commit beb300c. This will update automatically on new commits. Configure here.

@kinyoklion kinyoklion marked this pull request as ready for review January 28, 2026 20:36
@kinyoklion kinyoklion requested a review from a team as a code owner January 28, 2026 20:36
@kinyoklion kinyoklion marked this pull request as draft January 28, 2026 20:37
@kinyoklion

This comment was marked as outdated.

@kinyoklion

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

@kinyoklion
Copy link
Member Author

bugbot review

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a rename and a refactory, but not actually net-new. Basically I moved the initializers and the synchronizers to be managed by this, and to be iterator like.

So getting the next one handles all the shutdown conditions, setting it active, etc.

So a consumer just calls getNext until it returns null.

private void runInitializers() {
boolean anyDataReceived = false;
for (DataSourceFactory<Initializer> factory : initializers) {
Initializer initializer = sourceManager.getNextInitializerAndSetActive();
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved the initializers into the source manager so that shutdown and behavior was uniform. Basically iterate until you are out.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yay empty file.

);
result = FDv2SourceResult.interrupted(internalError, getFallback(event));
restartStream();
if(kind == DataSourceStatusProvider.ErrorKind.INVALID_DATA) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was the change for the other failing contract tests. This may be overly broad still. As MISSING_PAYLOAD is also in the category and not just JSON_ERROR.

cursor[bot]

This comment was marked as outdated.

@kinyoklion kinyoklion marked this pull request as ready for review January 29, 2026 00:29
cursor[bot]

This comment was marked as outdated.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

if (fallbackSynchronizer.polling != null &&
fallbackSynchronizer.polling.baseUri != null) {
endpoints.polling(fallbackSynchronizer.polling.baseUri);
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing streaming baseUri for FDv1 polling fallback

Medium Severity

When a streaming synchronizer is selected as the FDv1 fallback source (lines 646-650), its custom streaming.baseUri is not used to configure the global polling endpoint. The code only checks fallbackSynchronizer.polling which will be null for streaming synchronizers, causing the FDv1 polling fallback to use default endpoints instead of the custom environment's endpoints.

Fix in Cursor Fix in Web

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think I care.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants